﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web4Comment.Service;

namespace Web4Comment
{
    public partial class sinaSns : System.Web.UI.Page
    {
        SNSService service = new SNSService();

        protected void Page_Load(object sender, EventArgs e)
        {
            if ((String)Session["username"] == null || (String)Session["username"] == "")
            {
                Response.Redirect("./logon.aspx");
            }
            //test
            service.getAccessToken(1, Request["code"], (int)Session["user_id"]);

            if (Session["next_url"] == null)
            {
                Response.Redirect("/link.aspx?result=success");
            }
            else
            {
                String url = Session["next_url"] as String;
                Session.Remove("next_url");

                Response.Redirect(url);
            }
        }
    }
}